package com.zpark.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author xiaoyu
 * @version 1.0 2022/11/22
 */
@RestController
@RequestMapping("/ribbon02")
public class Ribbon02Controller {
    @Autowired
    private RestTemplate restTemplate;

    private final static String PATH = "http://server-ribbon/server";

    @RequestMapping("r2.do")
    public String getP() {
        return restTemplate.getForObject(PATH + "/port", String.class);
    }
}
